package com.management.service.Impl;

import com.management.dao.CommodityTypeDao;
import com.management.po.CommodityType;
import com.management.service.CommodityTypeService;
import com.management.vo.CommodityTypeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @version v1.0
 * @Author: Slark
 * @Date: Created in2021/10/29  19:48
 */
@Service
public class CommodityTypeServiceImpl implements CommodityTypeService {

    @Autowired
    CommodityTypeDao commodityTypeDao;

    @Override
    public List<CommodityTypeVO> findAll() {
        return commodityTypeDao.findAll();
    }

    @Override
    public List<CommodityTypeVO> findByCommodityTypeId(int commodityTypeId) {
        return commodityTypeDao.findByCommodityTypeId(commodityTypeId);
    }

    @Override
    public List<CommodityTypeVO> findByCompanyId(int companyId) {
        return commodityTypeDao.findByCompanyId(companyId);
    }

    @Override
    public int add(CommodityType commodityType) {
        return commodityTypeDao.add(commodityType);
    }

    @Override
    public int update(CommodityType commodityType) {
        return commodityTypeDao.update(commodityType);
    }
}
